<template>
  <div id="header">
    <div class="container">
      <div class="content-top">
        <h1 class="msg">桌面美化功能</h1>
        <div class="box"></div>
      </div>
      <div class="content-bottom">
        <ul>
          <template v-for="(item, index) in arr1">
            <li
              v-on="{ mouseleave: myLeave }"
              @mouseenter="myEnter(index)"
              :key="index"
            >
              <div class="b-top">
                <img
                  :src="
                    require('../assets/images/zhuomian' + (index + 1) + '.png')
                  "
                  alt=""
                />
              </div>
              <div class="b-middle">{{ item.title }}</div>
              <div class="b-bottom">{{ item.content }}</div>
              <div class="hover">
                <div class="hover-box" v-show="isShow == index">
                  <span class="i1 iconfont icon-bofang"></span>
                  <span class="i2">
                    <a :href="item.picUrl">功能演示</a>
                  </span>
                </div>
              </div>
            </li>
          </template>
        </ul>
      </div>
    </div>
  </div>
</template>


<style scoped lang="scss">
#header {
  width: 1200px;
  margin: 0 auto;
  .container {
    width: 1200px;
    margin: 0 auto;
    .content {
      .content-top {
        position: relative;
        .msg {
          text-align: center;
        }
        .box {
          position: absolute;
          left: 524px;
          top: 38px;
          width: 200px;
          border-radius: 10px;
          height: 10px;
          background-color: #f2dc45;
        }
      }
      .content-bottom {
        ul {
          margin-left: -18px;
          display: flex;
          flex-wrap: wrap;
          list-style: none;
          padding: 0;
          li {
            margin-top: 10px;
            margin-left: 21px;
            border: 1px solid gray;
            border-radius: 10px;
            width: 179px;
            height: 250px;
            .b-top {
              img {
                width: 179px;
                height: 100px;
              }
            }
            .b-middle {
              margin-top: 20px;
              font-size: 20px;
              font-weight: bold;
              margin-left: 10px;
            }
            .b-bottom {
              margin-top: 16px;
              color: #6e6e9b;
              margin-left: 10px;
            }
            .hover {
              position: relative;
              margin-top: 5px;
              margin-left: 30px;
              .hover-box {
                background-color: #f2dc45;
                width: 100px;
                height: 30px;
                line-height: 30px;
                border-radius: 20px;
                padding-left: 10px;
                position: absolute;
                left: 0;
                top: 0;
                .i1 {
                  color: #ffffff;
                }
                .i2 {
                  color: #ffffff;
                  a {
                    text-decoration: none;
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
</style>

<script>
import "../../public/zuomian";
// console.log(data);
export default {
  name: "compZhuomian",
  data() {
    return {
      isShow: -1,
      arr1: [],
    };
  },
  methods: {
    myEnter(i) {
      this.isShow = i;
    },
    myLeave() {
      this.isShow = false;
    },
  },
  mounted() {
    let dataArr1 = data1;
    this.arr1 = dataArr1;
    // console.log(this.arr);
  },
};
</script>